#ifndef  __AIP650_H
#define  __AIP650_H


#define	 KEY_DECODE_RF		0x01
#define	 KEY_DECODE_BOD		0x02

#define	 TIMING_NOMAL		0x00
#define	 TIMING_POWERON		0x01
#define	 TIMING_SHUTDOWN	0x02
#define	 TIMING_SWITCH		0x03


#define	 KEY_BOD_PW			0x47//0x44
#define  KEY_BOD_SPEED		0x4F//0x4C
#define  KEY_BOD_SWH		0x57//0x54
#define  KEY_BOD_TIMING		0x5F//0x5C 
//#define  KEY_BOD_PT			0x47 
#define  KEY_BOD_PS			0x7F 


#define	 DSP_BOD_LED1		0x20
#define  DSP_BOD_LED2		0x10
#define  DSP_BOD_LED3		0x08
#define  DSP_BOD_LED4		0x04 
#define  DSP_BOD_LED5		0x01
#define  DSP_BOD_LED6		0x02 

#define  CMD_SYS			0x48
#define  CMD_READ			0x4F
#define  CMD_DIG0			0x68
#define  CMD_DIG1			0x6A
#define  CMD_DIG2			0x6C
#define  CMD_DIG3			0x6E


#define	 DSP_OFF()			{Write_EEData(CMD_SYS,0x00);}
#define	 DSP_ON()			{Write_EEData(CMD_SYS,0x01);}
#define	 DSP_SLEEP()		{Write_EEData(CMD_SYS,0x04);}
#define	 DSP_8SEG_ON()		{Write_EEData(CMD_SYS,0x01);}

#define	 DSP_SYSON_1()		{Write_EEData(CMD_SYS,0x11);}
#define	 DSP_SYSON_2()		{Write_EEData(CMD_SYS,0x21);}
#define	 DSP_SYSON_3()		{Write_EEData(CMD_SYS,0x31);}
#define	 DSP_SYSON_4()		{Write_EEData(CMD_SYS,0x41);}
#define	 DSP_SYSON_5()		{Write_EEData(CMD_SYS,0x51);}
#define	 DSP_SYSON_6()		{Write_EEData(CMD_SYS,0x61);}
#define	 DSP_SYSON_7()		{Write_EEData(CMD_SYS,0x71);}
#define	 DSP_SYSON_8()		{Write_EEData(CMD_SYS,0x01);}

typedef struct 
{
	unsigned char ScanCycle;
	unsigned int   Data;
	unsigned char KeyVal;
	unsigned char LedVal;
	
}MBOD_T;

extern MBOD_T	t_board;


//extern void Update_Display(MBOD_T *p);
void Scan_key_board(void);
//void Scan_Led_board(unsigned char Val);
unsigned char Write_EEData(unsigned char GAddr_usEEAddr,unsigned char V_ucDataBuffer);
unsigned char Read_EEData(unsigned char GAddr_usEEAddr,unsigned char *V_ucDataBuffer);
#endif


